import type { Params } from "@/types/common"
import { $baseApi } from "@/utils/http-instance"

// 通过openid直接登录
export const $loginOnlyByWeixin = (params: Params) => {
	return $baseApi.get(`member-auth/login-only-by-weixin`, params, { reject: 1, loading: true })
}

// 通过手机号注册
export const $registerByMobile = (params: Params) => {
	return $baseApi.post(`member-auth/register-by-mobile`, params, { no_token: true })
}

// 获取手机号
export const $decryptMobile = (params: Params) => {
	return $baseApi.get(`mini-programs/decrypt-mobile`, params, { reject: 1 })
}

//通过微信code获取open_id
export const $code2Session = (params: Params) => {
	return $baseApi.get(`mini-programs/code-2-session-of-open`, params)
}
